﻿using HZH_Controls.Controls;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace 渐变.user_Form
{
    public partial class user_Unprocessed : Form
    {
        public user_Unprocessed()
        {
            InitializeComponent();
        }

        private void user_Unprocessed_Load(object sender, EventArgs e)
        {
            this.Dock = DockStyle.Fill;
        }
        public string opname { get; set; }
        private void ucDataGridView1_Load(object sender, EventArgs e)
        {
            List<DataGridViewColumnEntity> lstCulumns = new List<DataGridViewColumnEntity>();
            lstCulumns.Add(new DataGridViewColumnEntity() { DataField = "cid", HeadText = "编号", Width = 50, WidthType = SizeType.AutoSize });
            lstCulumns.Add(new DataGridViewColumnEntity() { DataField = "carname", HeadText = "车名", Width = 50, WidthType = SizeType.AutoSize });
            lstCulumns.Add(new DataGridViewColumnEntity() { DataField = "carid", HeadText = "车牌号", Width = 50, WidthType = SizeType.AutoSize });
            lstCulumns.Add(new DataGridViewColumnEntity() { DataField = "carproblem", HeadText = "问题", Width = 80, WidthType = SizeType.AutoSize });
            lstCulumns.Add(new DataGridViewColumnEntity() { DataField = "cdatetime", HeadText = "提交时间", Width = 80, WidthType = SizeType.AutoSize, Format = (a) => { return ((DateTime)a).ToString("yyyy-MM-dd HH:mm:ss"); } });
            this.ucDataGridView1.Columns = lstCulumns;
            // this.ucDataGridView1.IsShowCheckBox = true;
            string sql = "select * from complaint where isHandle='False' and cname=@cname";
            SqlParameter p = new SqlParameter("@cname", this.opname);
            DataTable dt = new DataTable();
            dt = DBHelper.ExecuteQuery(sql,p);
            this.ucDataGridView1.DataSource = dt;
            // this.ucDataGridView1.First();
        }
    }
}
